<%@ page import="org.springframework.web.context.WebApplicationContext" %>
<%@ page import="com.mg.service.UserService" %>
<%@ page import="com.mg.model.User" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ include file="../../common/taglibs.jsp" %>
<%@ include file="../../common/head.builive.inc.jsp" %>
<%@ include file="../../common/session.script.inc.jsp" %>
<html>
<%
    WebApplicationContext context = (WebApplicationContext) request.getServletContext().getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE);
    UserService userService = (UserService) context.getBean("userServiceImpl");
    User user = (User) request.getSession().getAttribute(Constants.USER_INFO);
    user=userService.getUser(user.getId());
%>
<head>
    <title>用户中心</title>
</head>
<link rel="stylesheet" type="text/css" href="${ctx}/pages/user/css/userCenter.css">
<body>

<div class="doc-content">
    <div class="userInfo-title">
        用户信息
    </div>
    <div id="content" class="info panel">
        <div class="panel-header">
            <h3>基本信息</h3>
        </div>
        <form id="userEditForm" class="form-horizontal ">
            <div class="row">
                <div class="control-group span24">
                    <label class="control-label">用户名称：</label>
                    <label class="userNameLabel userLabel"></label>
                    <div class="controls">
                        <input type="text" class="input-normal control-text userName" style="display: none"
                               data-rules="{required : true}"
                               name="userName">
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="control-group span24">
                    <label class="control-label">身份证号：</label>
                    <label class="identityCardLabel userLabel"></label>
                    <div class="controls">
                        <input type="text" style="display: none" class="input-normal control-text identityCard"
                               data-rules="{required : true}"
                               data-messages="{required:'身份证号不能为空'}" name="identityCard">
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="control-group span24">
                    <label class="control-label">手机号：</label>
                    <label class="userLabel"><%=user.getPhoneNumber()%></label>
                </div>
            </div>
            <div class="row">
                <div class="control-group span24">
                    <label class="userLabel userTip" style="margin-left: 60px;color: #ff0000;">如需修改请联系客服</label>
                </div>
            </div>
            <div class="row">
                <button type="button"  class="button button-success userBtn" style="display:none;margin-left: 75px">保存</button>
            </div>
        </form>
    </div>
    <div class="row panel info">
        <div class="panel-header">
            <h3>银行卡信息</h3>
        </div>
        <div id="bankCarGrid"></div>

    </div>

</div>
<div id="bankCarEditFormDialogContent" style="display: none">
    <form id="bankCarEditForm" class="form-horizontal ">
        <div class="row">
            <div class="control-group span14">
                <label class="control-label">银行名称：</label>
                <input type="hidden" name="id"/>
                <input type="hidden" name="userId"/>
                <div class="controls">
                    <input type="text" class="input-normal control-text"
                           data-rules="{required:true,maxlength:200}"
                           name="bankName">
                </div>
            </div>
            <div class="control-group span14">
                <label class="control-label">卡号：</label>
                <div class="controls">
                    <input type="text" class="input-normal control-text"
                           data-rules="{required:true,maxlength:200}"
                           name="carNo">
                </div>
            </div>
        </div>
    </form>

</div>
<script type="text/javascript">
    var user =<%=JsonUtils.toJson(user)%>
</script>
<script type="text/javascript" src="${ctx}/pages/user/js/userInfo.js"></script>
</body>
</html>